<?php
$HTMLstr .= '<div class="body">
    <div class="findOne">
    <div class="findOneInside">';

$i = 0;
foreach($this->allImgs as $oneImg) {
    if($oneImg->getId() == $this->oneModel->getId()) {
        $curr = $i;
    }
    $i++;
}
    $HTMLstr .= '<div class="findOneInsideImg">
        <img width="100%" src="stuff/images/saved/'. $this->oneModel->getName() .'.jpg">
            </div>
            <div class="space"></div>';
if(!empty($this->allImgs[$curr - 1])) {
    $HTMLstr .= '<div class="fetchallOneInsideTitle">
        <a href="?controller=photo&action=index&id='. $this->allImgs[$curr - 1]->getId() .'"><предыдущая</a>
            </div>';
}

if(!empty($this->allImgs[$curr + 1])) {
    $HTMLstr .= '<div class="fetchallOneInsideTitle">
        <a href="?controller=photo&action=index&id='. $this->allImgs[$curr + 1]->getId() .'">следующая></a>
            </div>';
}
$HTMLstr .= '<div class="head">
    '. $this->oneModel->getTitle() .'
        </div>
        <div class="space"></div>';

if ($user->getId() == $this->owner) {
    $HTMLstr .= '<div class="fetchallOneInsideAct">
        <a href="?controller=photo&action=edit&id='.$this->oneModel->getId().'">Редактировать описание</a>
            </div>
            <div class="fetchallOneInsideAct">
        <a href="?controller=photo&action=delete&id='.$this->oneModel->getId().'">Удалить</a>
            </div>';
}

$HTMLstr .= '<div class="fetchallOneInsideTitle">
    <a href="?controller=photo&action=index&user='. $this->owner .'">К альбому</a>
        </div>
        </div>
    </div>
        </div>';